<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="entity.Prod" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>主页面</title>
	</head>
	<body>
		<a href="add.jsp">添加商品</a>
		<hr>
		<div>欢迎您，<%=session.getAttribute("user") %></div>
		<table border="1" width=50%>
			<tr>
				<th>商品名称</th>
				<th>单价</th>
				<th>操作</th>
			</tr>
			<% List<Prod> list=(List<Prod>)request.getAttribute("prodList"); %>
			<% for(Prod prod:list){
			 %>
			<tr>
				<td><%=prod.getProdname() %></td>
				<td><%=prod.getPrice() %></td>
				<td><a href="update.jspx?id=<%=prod.getId() %>">修改</a>&nbsp;<a href="del.jspx?id=<%=prod.getId() %>">删除</a>&nbsp;<a href="addcar.jsp?id=<%=prod.getId() %>">购物</a></td>
			</tr>
			<% } %>
		</table>
	</body>
</html>